package com.share.example.selenium.config;

import com.alibaba.fastjson.JSON;
import com.share.example.selenium.service.IBaseConfService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Slf4j
@Component
public class BootInit {
    @Autowired
    private IBaseConfService baseConfService;

    @PostConstruct
    @Scheduled(cron = "0 0/30 * * * ?")
    public void initBaseConf() {
        log.info("---正在初始化或者刷新-initBaseConf---");
        Object result = baseConfService.init();
        log.info("initBaseConf-配置={}", JSON.toJSONString(result));
    }
}
